// Son 子组件
import React from 'react';
import Grandson from './grandson.jsx';
import { Consumer } from './Father';

export default class Son extends React.Component {
    render () {
        return (
            <Consumer>
                {
                    ({ name, age }) => (
                        <div>
                            子组件。获取父组件的值: {name}  -  {age}
                            <Grandson />
                        </div>
                    )
                }
            </Consumer>
        );
    }
}
